//
//
//
class CAvatar;

#ifndef CAVATAR_H
#define CAVATAR_H

#include <irrlicht.h>
#include <map>
#include "CRagdollSceneNode.h"
#include "CAction.h"
#include "CPhysicsObjectSceneNode.h"

using namespace irr;
using namespace core;
using namespace scene;

class CAvatar : public CRagdollSceneNode
{
public:
	//CAvatar();
	//bool	AddToSceneManager();
// 	CAvatar() : irr::scene::IAnimatedMeshSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id,
// 		const core::vector3df& position = core::vector3df(0,0,0),
// 		const core::vector3df& rotation = core::vector3df(0,0,0),
// 		const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f))
// 		: ISceneNode(parent, mgr, id, position, rotation, scale);

	virtual	void	Clear();
	virtual	double	GetHP()		{ return m_dfHP; }
	virtual	double	GetStamia()	{ return m_dfStamia; }
	virtual	double GetMaxHP()	{ return m_dfMaxHP; }
	virtual	double GetMaxStamia()	{ return m_dfMaxStamia; }
	virtual	bool	UpdateStatus();

	virtual	bool	IsInAnimation()	{ return m_bInAnimation; }

	virtual	bool	AddAction( const std::string& action_name, CAction*	action  );
protected:
private:
	int m_iPlayerID;
	double m_dfHP;
	double m_dfStamia;
	double m_dfMaxHP;
	double m_dfMaxStamia;

	bool	m_bInAnimation;

	std::map<std::string, CAction*>	m_mapActions;
	std::map<std::string, CPhysicsObjectSceneNode*>	m_mapWeapons;
};


// bool	addAvatarToSceneManager(IAnimatedMesh* mesh, ISceneNode* parent=0, s32 id=-1,
// 	const core::vector3df& position = core::vector3df(0,0,0),
// 	const core::vector3df& rotation = core::vector3df(0,0,0),
// 	const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f),
// 	bool alsoAddIfMeshPointerZero=false,
// 	ISceneManager* scene_manager);

#endif